/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package controller.toolbar;

import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import org.primefaces.event.ItemSelectEvent;

/**
 *
 * @author Shengyi_Chen
 */
@ManagedBean
@SessionScoped
public class SelectOneButtonController {

    /**
     * Creates a new instance of SelectOneButtonController
     */
    public SelectOneButtonController() {
        
        
    }
    
    
    public void onChangeEvent(ItemSelectEvent ce){
        FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "Button Clicked", "Current Select:" + ce.toString());
	addMessage(message);
    }
    
    private void addMessage(FacesMessage message) {
		FacesContext.getCurrentInstance().addMessage(null, message);
    }
}
